#include "soc/rtc_wdt.h"

void Task1(void* pvParameters)
{
  volatile uint32_t HighWaterMark = 0;
  volatile char uuu[100] = {0};  
  while(1)
  {
    vTaskDelay(5000);
    Serial.print("System free memory size: ");
    Serial.print(ESP.getFreeHeap());
    Serial.print(" bytes.\n");
  }
}
void setup()
{
  pinMode(uint8_t pin, uint8_t mode)
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.printf("System total memory size: %d bytes.\n", ESP.getHeapSize());
  Serial.printf("System free memory size: %d bytes.\n", ESP.getFreeHeap());
  TaskHandle_t Task1Handel;
  xTaskCreate(Task1, "Task1", 1024, NULL, 1, &Task1Handel);
  vTaskDelay(3000);
  uint32_t HighWaterMark = uxTaskGetStackHighWaterMark(Task1Handel);
  Serial.printf("Task1 used memory size: %d bytes.\n", 1024-HighWaterMark);  
  Serial.printf("Task1 free memory size: %d bytes.\n", HighWaterMark);

  Serial.printf("System free memory size: %d bytes.\n", ESP.getFreeHeap());
  vTaskDelete(NULL);
}

void loop()
{
  // put your main code here, to run repeatedly:

}
